package cn.dubito.demo.domain.repository;

import cn.dubito.demo.domain.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * @author liliang
 * @description:
 * @datetime 18/2/26 上午11:21
 */
public interface UserRepository extends JpaRepository<User, Long> {

    /**
     * 根据用户名查找
     * @param userName
     * @return
     */
    User findByUserName(String userName);

    /**
     * 根据邮箱或用户名查找
     * @param username
     * @param email
     * @return
     */
    User findByUserNameOrEmail(String username, String email);
}